package com.sti.platform.util;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.aisino.core.config.ConfigUtils;

/**
 * 初始化全局参数
 * 
 * @author
 */
public class ConfigServlet extends HttpServlet {

	private static final long serialVersionUID = -7462526216386306510L;
	
	private static final Logger LOGGER = LoggerFactory.getLogger(ConfigServlet.class);

	public void init() throws ServletException {
		ServletContext servletContext = getServletContext();
		servletContext.setAttribute("path", servletContext.getContextPath());
		try {
			servletContext.setAttribute("app.name", ConfigUtils.getProperty("app.name"));
			/*servletContext.setAttribute("_systemName", ConfigUtils.getProperty("system.name"));
			*/
		}
		catch (Exception e) {
			LOGGER.error("系统初始化参数配置有误", e);
		}
	}
}
